package com.bootdo.appsystem.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bootdo.appsystem.dao.OrderaddressinfoDao;
import com.bootdo.appsystem.domain.OrderaddressinfoDO;
import com.bootdo.appsystem.service.OrderaddressinfoService;



@Service
public class OrderaddressinfoServiceImpl implements OrderaddressinfoService {
	@Autowired
	private OrderaddressinfoDao orderaddressinfoDao;
	
	@Override
	public OrderaddressinfoDO get(Integer id){
		return orderaddressinfoDao.get(id);
	}
	
	@Override
	public List<OrderaddressinfoDO> list(Map<String, Object> map){
		return orderaddressinfoDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return orderaddressinfoDao.count(map);
	}
	
	@Override
	public int save(OrderaddressinfoDO orderaddressinfo){
		return orderaddressinfoDao.save(orderaddressinfo);
	}
	
	@Override
	public int update(OrderaddressinfoDO orderaddressinfo){
		return orderaddressinfoDao.update(orderaddressinfo);
	}
	
	@Override
	public int remove(Integer id){
		return orderaddressinfoDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return orderaddressinfoDao.batchRemove(ids);
	}

	@Override
	public OrderaddressinfoDO getByOrderCode(String orderCode) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("ordercode",orderCode);
        List<OrderaddressinfoDO> list = this.list(map);
        if(list.size() > 0){
            return list.get(0);
        }
        return null;
	}

}
